#ifndef FILEHELPER_H
#define FILEHELPER_H

#include <QObject>
#include <QString>
#include <QVariantMap>

class FileHelper : public QObject
{
    Q_OBJECT
public:
    explicit FileHelper(QObject *parent = nullptr);

public slots:
    Q_INVOKABLE bool write(const QString &path, const QString &data);
    Q_INVOKABLE void saveHistory(const QString &historyJson);
    Q_INVOKABLE QString loadHistory();
    Q_INVOKABLE QVariantMap loadUserPrompts();
    Q_INVOKABLE void saveUserPrompt(const QString &field, const QString &prompt);
    Q_INVOKABLE void clearUserPrompts();

private:
    QString m_historyFilePath;
};

#endif // FILEHELPER_H